/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * GameScreen.java
 *
 * Created on Jun 13, 2010, 2:29:36 PM
 */

package frontEnd;
import backEnd.Addition;
import backEnd.Game;
import backEnd.Multiplication;
import backEnd.Player;
import javax.swing.JButton;
import javax.swing.JOptionPane;
/**
 *
 * @author sneha
 */
public class GameScreen extends javax.swing.JFrame {

    private Game game;
    
    //To keep track of whose turn it is 
    private Player currentPlayer;

    /** Creates new form GameScreen */
    public GameScreen() {
        initComponents();
    }

    public GameScreen(String gameType, String player1, String player2){
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                setVisible(true);
            }
        });
        initComponents();

        // Determine gameType and call respective game object
        if(gameType.equals("Addition"))
        {
            gameTypeButton.setText("ADD");
            setTextOnButtons("+");
            game = new Addition(player1, player2);
        }
        else if(gameType.equals("Multiplication"))
        {
            gameTypeButton.setText("MUL");
            setTextOnButtons("*");
            game = new Multiplication(player1, player2);
        }

        // Display Player names
        player1Name.setFont(new java.awt.Font("Tahoma", 0, 24));
        player1Name.setText(player1);
        player2Name.setFont(new java.awt.Font("Tahoma", 0, 24));
        player2Name.setText(player2);

        //Display hint
        hintText.setFont(new java.awt.Font("Tahoma", 0, 24));
        hintText.setText(game.hint.getNextHint());

        //Displlay whose turn it is
        player1Status.setFont(new java.awt.Font("Tahoma", 0, 24));
        player1Status.setText("PLAY");

        player2Status.setFont(new java.awt.Font("Tahoma", 0, 24));
        player2Status.setText("WAIT");

        //By default player1 is supposed to start
        currentPlayer = game.player1;
    }

    //Initialise button text depending on game type
    private void setTextOnButtons(String arg){
        gameBoardButton11.setText(arg);
        gameBoardButton12.setText(arg);
        gameBoardButton13.setText(arg);
        gameBoardButton14.setText(arg);
        gameBoardButton15.setText(arg);
        gameBoardButton16.setText(arg);
        gameBoardButton17.setText(arg);
        gameBoardButton18.setText(arg);
        gameBoardButton19.setText(arg);
        gameBoardButton21.setText(arg);
        gameBoardButton22.setText(arg);
        gameBoardButton23.setText(arg);
        gameBoardButton24.setText(arg);
        gameBoardButton25.setText(arg);
        gameBoardButton26.setText(arg);
        gameBoardButton27.setText(arg);
        gameBoardButton28.setText(arg);
        gameBoardButton29.setText(arg);
        gameBoardButton31.setText(arg);
        gameBoardButton32.setText(arg);
        gameBoardButton33.setText(arg);
        gameBoardButton34.setText(arg);
        gameBoardButton35.setText(arg);
        gameBoardButton36.setText(arg);
        gameBoardButton37.setText(arg);
        gameBoardButton38.setText(arg);
        gameBoardButton39.setText(arg);
        gameBoardButton41.setText(arg);
        gameBoardButton42.setText(arg);
        gameBoardButton43.setText(arg);
        gameBoardButton44.setText(arg);
        gameBoardButton45.setText(arg);
        gameBoardButton46.setText(arg);
        gameBoardButton47.setText(arg);
        gameBoardButton48.setText(arg);
        gameBoardButton49.setText(arg);
        gameBoardButton51.setText(arg);
        gameBoardButton52.setText(arg);
        gameBoardButton53.setText(arg);
        gameBoardButton54.setText(arg);
        gameBoardButton55.setText(arg);
        gameBoardButton56.setText(arg);
        gameBoardButton57.setText(arg);
        gameBoardButton58.setText(arg);
        gameBoardButton59.setText(arg);
        gameBoardButton61.setText(arg);
        gameBoardButton62.setText(arg);
        gameBoardButton63.setText(arg);
        gameBoardButton64.setText(arg);
        gameBoardButton65.setText(arg);
        gameBoardButton66.setText(arg);
        gameBoardButton67.setText(arg);
        gameBoardButton68.setText(arg);
        gameBoardButton69.setText(arg);
        gameBoardButton71.setText(arg);
        gameBoardButton72.setText(arg);
        gameBoardButton73.setText(arg);
        gameBoardButton74.setText(arg);
        gameBoardButton75.setText(arg);
        gameBoardButton76.setText(arg);
        gameBoardButton77.setText(arg);
        gameBoardButton78.setText(arg);
        gameBoardButton79.setText(arg);
        gameBoardButton81.setText(arg);
        gameBoardButton82.setText(arg);
        gameBoardButton83.setText(arg);
        gameBoardButton84.setText(arg);
        gameBoardButton85.setText(arg);
        gameBoardButton86.setText(arg);
        gameBoardButton87.setText(arg);
        gameBoardButton88.setText(arg);
        gameBoardButton89.setText(arg);
        gameBoardButton91.setText(arg);
        gameBoardButton92.setText(arg);
        gameBoardButton93.setText(arg);
        gameBoardButton94.setText(arg);
        gameBoardButton95.setText(arg);
        gameBoardButton96.setText(arg);
        gameBoardButton97.setText(arg);
        gameBoardButton98.setText(arg);
        gameBoardButton99.setText(arg);
    }

    // Change button text when player makes a move
    // TO DO : button color should change and text should reflect result of operation
    private void changeButtonColor(JButton b)
    {
        if(currentPlayer.equals(game.player1))
        {
            b.setText("B");
        }
        else if(currentPlayer.equals(game.player2))
        {
            b.setText("R");
        }
    }

    // Check if any player has won
    // Switch current player
    // Set next hint
    private void updatePlayerStatus(String result){
        if(currentPlayer.equals(game.player1)){
            // If player 1 has won
            if(game.won == 1){
                JOptionPane.showMessageDialog(rootPane, "Congratulations!! " + game.player1.getName() + ".. You win!!");
                player1Status.setText("WINS");
                player2Status.setText("LOSES");
            }
            else{
                player1Status.setText("WAIT");
                player2Status.setText("PLAY");
                pastMoves.setText(pastMoves.getText() + "\n" + currentPlayer.getName());
                currentPlayer = game.player2;
            }
        }
        else if(currentPlayer.equals(game.player2)){
            // if player 2 has won
            if(game.won == 2){
                JOptionPane.showMessageDialog(rootPane, "Congratulations!! " + game.player2.getName() + ".. You win!!");
                player1Status.setText("WINS");
                player2Status.setText("LOSES");
            }
            else {
                player2Status.setText("WAIT");
                player1Status.setText("PLAY");
                pastMoves.setText(pastMoves.getText() + "\n" + currentPlayer.getName());
                currentPlayer = game.player1;
            }
        }
        // set next hint
        hintText.setText(game.hint.getNextHint());
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        gameTypeButton = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();
        jButton11 = new javax.swing.JButton();
        gameBoardButton11 = new javax.swing.JButton();
        gameBoardButton12 = new javax.swing.JButton();
        gameBoardButton13 = new javax.swing.JButton();
        gameBoardButton14 = new javax.swing.JButton();
        gameBoardButton15 = new javax.swing.JButton();
        gameBoardButton16 = new javax.swing.JButton();
        gameBoardButton17 = new javax.swing.JButton();
        gameBoardButton18 = new javax.swing.JButton();
        gameBoardButton19 = new javax.swing.JButton();
        jButton21 = new javax.swing.JButton();
        gameBoardButton21 = new javax.swing.JButton();
        gameBoardButton22 = new javax.swing.JButton();
        gameBoardButton23 = new javax.swing.JButton();
        gameBoardButton24 = new javax.swing.JButton();
        gameBoardButton25 = new javax.swing.JButton();
        gameBoardButton26 = new javax.swing.JButton();
        gameBoardButton27 = new javax.swing.JButton();
        gameBoardButton28 = new javax.swing.JButton();
        gameBoardButton29 = new javax.swing.JButton();
        jButton31 = new javax.swing.JButton();
        gameBoardButton31 = new javax.swing.JButton();
        gameBoardButton32 = new javax.swing.JButton();
        gameBoardButton33 = new javax.swing.JButton();
        gameBoardButton34 = new javax.swing.JButton();
        gameBoardButton35 = new javax.swing.JButton();
        gameBoardButton36 = new javax.swing.JButton();
        gameBoardButton37 = new javax.swing.JButton();
        gameBoardButton38 = new javax.swing.JButton();
        gameBoardButton39 = new javax.swing.JButton();
        jButton41 = new javax.swing.JButton();
        gameBoardButton41 = new javax.swing.JButton();
        gameBoardButton42 = new javax.swing.JButton();
        gameBoardButton43 = new javax.swing.JButton();
        gameBoardButton44 = new javax.swing.JButton();
        gameBoardButton45 = new javax.swing.JButton();
        gameBoardButton46 = new javax.swing.JButton();
        gameBoardButton47 = new javax.swing.JButton();
        gameBoardButton48 = new javax.swing.JButton();
        gameBoardButton49 = new javax.swing.JButton();
        jButton51 = new javax.swing.JButton();
        gameBoardButton51 = new javax.swing.JButton();
        gameBoardButton52 = new javax.swing.JButton();
        gameBoardButton53 = new javax.swing.JButton();
        gameBoardButton54 = new javax.swing.JButton();
        gameBoardButton55 = new javax.swing.JButton();
        gameBoardButton56 = new javax.swing.JButton();
        gameBoardButton57 = new javax.swing.JButton();
        gameBoardButton58 = new javax.swing.JButton();
        gameBoardButton59 = new javax.swing.JButton();
        jButton61 = new javax.swing.JButton();
        gameBoardButton61 = new javax.swing.JButton();
        gameBoardButton62 = new javax.swing.JButton();
        gameBoardButton63 = new javax.swing.JButton();
        gameBoardButton64 = new javax.swing.JButton();
        gameBoardButton65 = new javax.swing.JButton();
        gameBoardButton66 = new javax.swing.JButton();
        gameBoardButton67 = new javax.swing.JButton();
        gameBoardButton68 = new javax.swing.JButton();
        gameBoardButton69 = new javax.swing.JButton();
        jButton71 = new javax.swing.JButton();
        gameBoardButton71 = new javax.swing.JButton();
        gameBoardButton72 = new javax.swing.JButton();
        gameBoardButton73 = new javax.swing.JButton();
        gameBoardButton74 = new javax.swing.JButton();
        gameBoardButton75 = new javax.swing.JButton();
        gameBoardButton76 = new javax.swing.JButton();
        gameBoardButton77 = new javax.swing.JButton();
        gameBoardButton78 = new javax.swing.JButton();
        gameBoardButton79 = new javax.swing.JButton();
        jButton81 = new javax.swing.JButton();
        gameBoardButton81 = new javax.swing.JButton();
        gameBoardButton82 = new javax.swing.JButton();
        gameBoardButton83 = new javax.swing.JButton();
        gameBoardButton84 = new javax.swing.JButton();
        gameBoardButton85 = new javax.swing.JButton();
        gameBoardButton86 = new javax.swing.JButton();
        gameBoardButton87 = new javax.swing.JButton();
        gameBoardButton88 = new javax.swing.JButton();
        gameBoardButton89 = new javax.swing.JButton();
        jButton91 = new javax.swing.JButton();
        gameBoardButton91 = new javax.swing.JButton();
        gameBoardButton92 = new javax.swing.JButton();
        gameBoardButton93 = new javax.swing.JButton();
        gameBoardButton94 = new javax.swing.JButton();
        gameBoardButton95 = new javax.swing.JButton();
        gameBoardButton96 = new javax.swing.JButton();
        gameBoardButton97 = new javax.swing.JButton();
        gameBoardButton98 = new javax.swing.JButton();
        gameBoardButton99 = new javax.swing.JButton();
        helpButton = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        pastMoves = new javax.swing.JTextArea();
        jLabel4 = new javax.swing.JLabel();
        player1Name = new javax.swing.JLabel();
        player2Name = new javax.swing.JLabel();
        hintText = new javax.swing.JLabel();
        player1Status = new javax.swing.JLabel();
        player2Status = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setLayout(new java.awt.GridLayout(10, 10));

        gameTypeButton.setText("MUL");
        jPanel1.add(gameTypeButton);

        jButton2.setText("1");
        jPanel1.add(jButton2);

        jButton3.setText("2");
        jPanel1.add(jButton3);

        jButton4.setText("3");
        jPanel1.add(jButton4);

        jButton5.setText("4");
        jPanel1.add(jButton5);

        jButton6.setText("5");
        jPanel1.add(jButton6);

        jButton7.setText("6");
        jPanel1.add(jButton7);

        jButton8.setText("7");
        jPanel1.add(jButton8);

        jButton9.setText("8");
        jPanel1.add(jButton9);

        jButton10.setText("9");
        jPanel1.add(jButton10);

        jButton11.setText("1");
        jPanel1.add(jButton11);

        gameBoardButton11.setText("??");
        gameBoardButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton11ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton11);

        gameBoardButton12.setText("??");
        gameBoardButton12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton12ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton12);

        gameBoardButton13.setText("??");
        gameBoardButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton13ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton13);

        gameBoardButton14.setText("??");
        gameBoardButton14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton14ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton14);

        gameBoardButton15.setText("??");
        gameBoardButton15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton15ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton15);

        gameBoardButton16.setText("??");
        gameBoardButton16.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton16ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton16);

        gameBoardButton17.setText("??");
        gameBoardButton17.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton17ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton17);

        gameBoardButton18.setText("??");
        gameBoardButton18.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton18ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton18);

        gameBoardButton19.setText("??");
        gameBoardButton19.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton19ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton19);

        jButton21.setText("2");
        jPanel1.add(jButton21);

        gameBoardButton21.setText("??");
        gameBoardButton21.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton21ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton21);

        gameBoardButton22.setText("??");
        gameBoardButton22.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton22ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton22);

        gameBoardButton23.setText("??");
        gameBoardButton23.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton23ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton23);

        gameBoardButton24.setText("??");
        gameBoardButton24.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton24ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton24);

        gameBoardButton25.setText("??");
        gameBoardButton25.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton25ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton25);

        gameBoardButton26.setText("??");
        gameBoardButton26.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton26ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton26);

        gameBoardButton27.setText("??");
        gameBoardButton27.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton27ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton27);

        gameBoardButton28.setText("??");
        gameBoardButton28.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton28ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton28);

        gameBoardButton29.setText("??");
        gameBoardButton29.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton29ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton29);

        jButton31.setText("3");
        jPanel1.add(jButton31);

        gameBoardButton31.setText("??");
        gameBoardButton31.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton31ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton31);

        gameBoardButton32.setText("??");
        gameBoardButton32.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton32ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton32);

        gameBoardButton33.setText("??");
        gameBoardButton33.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton33ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton33);

        gameBoardButton34.setText("??");
        gameBoardButton34.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton34ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton34);

        gameBoardButton35.setText("??");
        gameBoardButton35.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton35ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton35);

        gameBoardButton36.setText("??");
        gameBoardButton36.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton36ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton36);

        gameBoardButton37.setText("??");
        gameBoardButton37.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton37ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton37);

        gameBoardButton38.setText("??");
        gameBoardButton38.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton38ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton38);

        gameBoardButton39.setText("??");
        gameBoardButton39.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton39ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton39);

        jButton41.setText("4");
        jPanel1.add(jButton41);

        gameBoardButton41.setText("??");
        gameBoardButton41.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton41ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton41);

        gameBoardButton42.setText("??");
        gameBoardButton42.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton42ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton42);

        gameBoardButton43.setText("??");
        gameBoardButton43.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton43ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton43);

        gameBoardButton44.setText("??");
        gameBoardButton44.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton44ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton44);

        gameBoardButton45.setText("??");
        gameBoardButton45.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton45ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton45);

        gameBoardButton46.setText("??");
        gameBoardButton46.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton46ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton46);

        gameBoardButton47.setText("??");
        gameBoardButton47.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton47ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton47);

        gameBoardButton48.setText("??");
        gameBoardButton48.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton48ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton48);

        gameBoardButton49.setText("??");
        gameBoardButton49.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton49ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton49);

        jButton51.setText("5");
        jPanel1.add(jButton51);

        gameBoardButton51.setText("??");
        gameBoardButton51.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton51ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton51);

        gameBoardButton52.setText("??");
        gameBoardButton52.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton52ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton52);

        gameBoardButton53.setText("??");
        gameBoardButton53.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton53ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton53);

        gameBoardButton54.setText("??");
        gameBoardButton54.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton54ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton54);

        gameBoardButton55.setText("??");
        gameBoardButton55.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton55ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton55);

        gameBoardButton56.setText("??");
        gameBoardButton56.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton56ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton56);

        gameBoardButton57.setText("??");
        gameBoardButton57.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton57ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton57);

        gameBoardButton58.setText("??");
        gameBoardButton58.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton58ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton58);

        gameBoardButton59.setText("??");
        gameBoardButton59.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton59ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton59);

        jButton61.setText("6");
        jPanel1.add(jButton61);

        gameBoardButton61.setText("??");
        gameBoardButton61.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton61ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton61);

        gameBoardButton62.setText("??");
        gameBoardButton62.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton62ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton62);

        gameBoardButton63.setText("??");
        gameBoardButton63.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton63ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton63);

        gameBoardButton64.setText("??");
        gameBoardButton64.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton64ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton64);

        gameBoardButton65.setText("??");
        gameBoardButton65.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton65ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton65);

        gameBoardButton66.setText("??");
        gameBoardButton66.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton66ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton66);

        gameBoardButton67.setText("??");
        gameBoardButton67.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton67ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton67);

        gameBoardButton68.setText("??");
        gameBoardButton68.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton68ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton68);

        gameBoardButton69.setText("??");
        gameBoardButton69.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton69ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton69);

        jButton71.setText("7");
        jPanel1.add(jButton71);

        gameBoardButton71.setText("??");
        gameBoardButton71.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton71ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton71);

        gameBoardButton72.setText("??");
        gameBoardButton72.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton72ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton72);

        gameBoardButton73.setText("??");
        gameBoardButton73.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton73ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton73);

        gameBoardButton74.setText("??");
        gameBoardButton74.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton74ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton74);

        gameBoardButton75.setText("??");
        gameBoardButton75.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton75ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton75);

        gameBoardButton76.setText("??");
        gameBoardButton76.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton76ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton76);

        gameBoardButton77.setText("??");
        gameBoardButton77.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton77ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton77);

        gameBoardButton78.setText("??");
        gameBoardButton78.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton78ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton78);

        gameBoardButton79.setText("??");
        gameBoardButton79.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton79ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton79);

        jButton81.setText("8");
        jPanel1.add(jButton81);

        gameBoardButton81.setText("??");
        gameBoardButton81.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton81ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton81);

        gameBoardButton82.setText("??");
        gameBoardButton82.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton82ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton82);

        gameBoardButton83.setText("??");
        gameBoardButton83.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton83ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton83);

        gameBoardButton84.setText("??");
        gameBoardButton84.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton84ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton84);

        gameBoardButton85.setText("??");
        gameBoardButton85.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton85ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton85);

        gameBoardButton86.setText("??");
        gameBoardButton86.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton86ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton86);

        gameBoardButton87.setText("??");
        gameBoardButton87.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton87ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton87);

        gameBoardButton88.setText("??");
        gameBoardButton88.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton88ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton88);

        gameBoardButton89.setText("??");
        gameBoardButton89.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton89ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton89);

        jButton91.setText("9");
        jPanel1.add(jButton91);

        gameBoardButton91.setText("??");
        gameBoardButton91.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton91ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton91);

        gameBoardButton92.setText("??");
        gameBoardButton92.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton92ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton92);

        gameBoardButton93.setText("??");
        gameBoardButton93.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton93ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton93);

        gameBoardButton94.setText("??");
        gameBoardButton94.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton94ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton94);

        gameBoardButton95.setText("??");
        gameBoardButton95.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton95ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton95);

        gameBoardButton96.setText("??");
        gameBoardButton96.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton96ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton96);

        gameBoardButton97.setText("??");
        gameBoardButton97.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton97ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton97);

        gameBoardButton98.setText("??");
        gameBoardButton98.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton98ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton98);

        gameBoardButton99.setText("??");
        gameBoardButton99.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gameBoardButton99ActionPerformed(evt);
            }
        });
        jPanel1.add(gameBoardButton99);

        helpButton.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        helpButton.setText("HELP");
        helpButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                helpButtonActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24));
        jLabel1.setText("Hint:");

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 24));
        jLabel2.setText("Player:");

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 24));
        jLabel3.setText("Opponent:");

        pastMoves.setColumns(20);
        pastMoves.setRows(5);
        jScrollPane1.setViewportView(pastMoves);

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 24));
        jLabel4.setText("Past Moves:");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(player1Status, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jLabel2)
                        .addComponent(player1Name, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE)))
                .addGap(51, 51, 51)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel4)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 550, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel1)
                                .addGap(18, 18, 18)
                                .addComponent(hintText, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGap(71, 71, 71)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(player2Status, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(player2Name, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE)
                            .addComponent(jLabel3)))
                    .addComponent(helpButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(22, 22, 22))
        );

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel3, player2Name, player2Status});

        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(helpButton, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(hintText, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE))
                .addGap(35, 35, 35)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addGap(18, 18, 18)
                        .addComponent(player2Name, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(player2Status, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addGap(18, 18, 18)
                        .addComponent(player1Name, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(player1Status, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 461, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(36, 36, 36)
                .addComponent(jLabel4)
                .addGap(33, 33, 33)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(75, 75, 75))
        );

        layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel2, player1Name, player1Status});

        pack();
    }// </editor-fold>//GEN-END:initComponents


    private void gameBoardButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton11ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(1, 1);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton11);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (1, 1)");
        }
        
    }//GEN-LAST:event_gameBoardButton11ActionPerformed

    private void gameBoardButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton12ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(1, 2);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton12);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (1, 2)");
        }
    }//GEN-LAST:event_gameBoardButton12ActionPerformed

    private void gameBoardButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton13ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(1, 3);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton13);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (1, 3)");
        }
    }//GEN-LAST:event_gameBoardButton13ActionPerformed

    private void gameBoardButton14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton14ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(1, 4);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton14);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (1, 4)");
        }
    }//GEN-LAST:event_gameBoardButton14ActionPerformed

    private void gameBoardButton15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton15ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(1, 5);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton15);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (1, 5)");
        }
    }//GEN-LAST:event_gameBoardButton15ActionPerformed

    private void gameBoardButton16ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton16ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(1, 6);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton16);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (1, 6)");
        }
    }//GEN-LAST:event_gameBoardButton16ActionPerformed

    private void gameBoardButton17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton17ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(1, 7);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton17);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (1, 8)");
        }
    }//GEN-LAST:event_gameBoardButton17ActionPerformed

    private void gameBoardButton18ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton18ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(1, 8);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton18);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (1, 9)");
        }
    }//GEN-LAST:event_gameBoardButton18ActionPerformed

    private void gameBoardButton19ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton19ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(1, 9);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton19);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (2, 1)");
        }
    }//GEN-LAST:event_gameBoardButton19ActionPerformed

    private void gameBoardButton21ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton21ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(2, 1);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton21);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (2, 2)");
        }
    }//GEN-LAST:event_gameBoardButton21ActionPerformed

    private void gameBoardButton22ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton22ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(2, 2);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton22);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (2, 3)");
        }
    }//GEN-LAST:event_gameBoardButton22ActionPerformed

    private void gameBoardButton23ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton23ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(2, 3);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton23);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (2, 3)");
        }
    }//GEN-LAST:event_gameBoardButton23ActionPerformed

    private void gameBoardButton24ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton24ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(2, 4);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton24);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (2, 4)");
        }
    }//GEN-LAST:event_gameBoardButton24ActionPerformed

    private void gameBoardButton25ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton25ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(2, 5);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton25);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (2, 5)");
        }
    }//GEN-LAST:event_gameBoardButton25ActionPerformed

    private void gameBoardButton26ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton26ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(2, 6);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton26);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (2, 6)");
        }
    }//GEN-LAST:event_gameBoardButton26ActionPerformed

    private void gameBoardButton27ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton27ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(2, 7);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton27);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (2, 7)");
        }
    }//GEN-LAST:event_gameBoardButton27ActionPerformed

    private void gameBoardButton28ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton28ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(2, 8);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton28);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (2, 8)");
        }
    }//GEN-LAST:event_gameBoardButton28ActionPerformed

    private void gameBoardButton29ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton29ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(2, 9);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton29);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (2, 9)");
        }
    }//GEN-LAST:event_gameBoardButton29ActionPerformed

    private void gameBoardButton31ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton31ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(3, 1);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton31);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (3, 1)");
        }
    }//GEN-LAST:event_gameBoardButton31ActionPerformed

    private void gameBoardButton32ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton32ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(3, 2);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton32);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (3, 2)");
        }
    }//GEN-LAST:event_gameBoardButton32ActionPerformed

    private void gameBoardButton33ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton33ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(3, 3);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton33);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (3, 3)");
        };
    }//GEN-LAST:event_gameBoardButton33ActionPerformed

    private void gameBoardButton34ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton34ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(3, 4);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton34);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (3, 4)");
        }
    }//GEN-LAST:event_gameBoardButton34ActionPerformed

    private void gameBoardButton35ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton35ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(3, 5);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton35);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (3, 5)");
        }
    }//GEN-LAST:event_gameBoardButton35ActionPerformed

    private void gameBoardButton36ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton36ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(3, 6);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton36);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (3, 6)");
        }
    }//GEN-LAST:event_gameBoardButton36ActionPerformed

    private void gameBoardButton37ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton37ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(3, 7);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton37);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (3, 7)");
        }
    }//GEN-LAST:event_gameBoardButton37ActionPerformed

    private void gameBoardButton38ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton38ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(3, 8);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton38);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (3, 8)");
        }
    }//GEN-LAST:event_gameBoardButton38ActionPerformed

    private void gameBoardButton39ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton39ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(3, 9);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton39);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (3, 9)");
        }
    }//GEN-LAST:event_gameBoardButton39ActionPerformed

    private void gameBoardButton41ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton41ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(4, 1);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton41);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (4, 1)");
        }
    }//GEN-LAST:event_gameBoardButton41ActionPerformed

    private void gameBoardButton42ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton42ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(4, 2);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton42);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (4, 2)");
        }
    }//GEN-LAST:event_gameBoardButton42ActionPerformed

    private void gameBoardButton43ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton43ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(4, 3);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton43);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (4, 3)");
        }
    }//GEN-LAST:event_gameBoardButton43ActionPerformed

    private void gameBoardButton44ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton44ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(4, 4);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton44);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (4, 4)");
        }
    }//GEN-LAST:event_gameBoardButton44ActionPerformed

    private void gameBoardButton45ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton45ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(4, 5);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton45);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (4, 5)");
        }
    }//GEN-LAST:event_gameBoardButton45ActionPerformed

    private void gameBoardButton46ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton46ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(4, 6);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton46);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (4, 6)");
        }
    }//GEN-LAST:event_gameBoardButton46ActionPerformed

    private void gameBoardButton47ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton47ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(4, 7);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton47);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (4, 7)");
        }
    }//GEN-LAST:event_gameBoardButton47ActionPerformed

    private void gameBoardButton48ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton48ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(4, 8);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton48);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (4, 8)");
        }
    }//GEN-LAST:event_gameBoardButton48ActionPerformed

    private void gameBoardButton49ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton49ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(4, 9);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton49);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (4, 9)");
        }
    }//GEN-LAST:event_gameBoardButton49ActionPerformed

    private void gameBoardButton51ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton51ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(5, 1);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton51);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (5, 1)");
        }
    }//GEN-LAST:event_gameBoardButton51ActionPerformed

    private void gameBoardButton52ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton52ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(5, 2);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton52);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (5, 2)");
        }
    }//GEN-LAST:event_gameBoardButton52ActionPerformed

    private void gameBoardButton53ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton53ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(5, 3);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton53);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (5, 3)");
        }
    }//GEN-LAST:event_gameBoardButton53ActionPerformed

    private void gameBoardButton54ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton54ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(5, 4);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton54);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (5, 4)");
        }
    }//GEN-LAST:event_gameBoardButton54ActionPerformed

    private void gameBoardButton55ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton55ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(5, 5);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton55);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (5, 5)");
        }
    }//GEN-LAST:event_gameBoardButton55ActionPerformed

    private void gameBoardButton56ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton56ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(5, 6);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton56);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (5, 6)");
        }
    }//GEN-LAST:event_gameBoardButton56ActionPerformed

    private void gameBoardButton57ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton57ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(5, 7);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton57);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (5, 7)");
        }
    }//GEN-LAST:event_gameBoardButton57ActionPerformed

    private void gameBoardButton58ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton58ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(5, 8);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton58);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (5, 8)");
        }
    }//GEN-LAST:event_gameBoardButton58ActionPerformed

    private void gameBoardButton59ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton59ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(5, 9);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton59);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (5, 9)");
        }
    }//GEN-LAST:event_gameBoardButton59ActionPerformed

    private void gameBoardButton61ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton61ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(6, 1);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton61);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (6, 1)");
        }
    }//GEN-LAST:event_gameBoardButton61ActionPerformed

    private void gameBoardButton62ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton62ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(6, 2);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton62);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (6, 2)");
        }
    }//GEN-LAST:event_gameBoardButton62ActionPerformed

    private void gameBoardButton63ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton63ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(6, 3);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton63);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (6, 3)");
        }
    }//GEN-LAST:event_gameBoardButton63ActionPerformed

    private void gameBoardButton64ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton64ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(6, 4);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton64);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (6, 4)");
        }
    }//GEN-LAST:event_gameBoardButton64ActionPerformed

    private void gameBoardButton65ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton65ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(6, 5);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton65);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (6, 5)");
        }
    }//GEN-LAST:event_gameBoardButton65ActionPerformed

    private void gameBoardButton66ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton66ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(6, 6);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton66);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (6, 6)");
        }
    }//GEN-LAST:event_gameBoardButton66ActionPerformed

    private void gameBoardButton67ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton67ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(6, 7);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton67);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (6, 7)");
        }
    }//GEN-LAST:event_gameBoardButton67ActionPerformed

    private void gameBoardButton68ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton68ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(6, 8);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton68);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (6, 8)");
        }
    }//GEN-LAST:event_gameBoardButton68ActionPerformed

    private void gameBoardButton69ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton69ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(6, 9);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton69);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (6, 9)");
        }
    }//GEN-LAST:event_gameBoardButton69ActionPerformed

    private void gameBoardButton71ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton71ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(7, 1);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton71);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (7, 1)");
        }
    }//GEN-LAST:event_gameBoardButton71ActionPerformed

    private void gameBoardButton72ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton72ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(7, 2);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton72);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (7, 2)");
        }
    }//GEN-LAST:event_gameBoardButton72ActionPerformed

    private void gameBoardButton73ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton73ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(7, 3);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton73);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (7, 3)");
        }
    }//GEN-LAST:event_gameBoardButton73ActionPerformed

    private void gameBoardButton74ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton74ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(7, 4);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton74);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (7, 4)");
        }
    }//GEN-LAST:event_gameBoardButton74ActionPerformed

    private void gameBoardButton75ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton75ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(7, 5);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton75);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (7, 5)");
        }
    }//GEN-LAST:event_gameBoardButton75ActionPerformed

    private void gameBoardButton76ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton76ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(7, 6);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton76);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (7, 6)");
        }
    }//GEN-LAST:event_gameBoardButton76ActionPerformed

    private void gameBoardButton77ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton77ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(7, 7);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton77);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (7, 7)");
        }
    }//GEN-LAST:event_gameBoardButton77ActionPerformed

    private void gameBoardButton78ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton78ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(7, 8);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton78);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (7, 8)");
        }
    }//GEN-LAST:event_gameBoardButton78ActionPerformed

    private void gameBoardButton79ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton79ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(7, 9);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton79);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (7, 9)");
        }
    }//GEN-LAST:event_gameBoardButton79ActionPerformed

    private void gameBoardButton81ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton81ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(8, 1);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton81);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (8, 1)");
        }
    }//GEN-LAST:event_gameBoardButton81ActionPerformed

    private void gameBoardButton82ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton82ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(8, 2);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton82);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (8, 2)");
        }
    }//GEN-LAST:event_gameBoardButton82ActionPerformed

    private void gameBoardButton83ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton83ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(8, 3);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton83);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (8, 3)");
        }
    }//GEN-LAST:event_gameBoardButton83ActionPerformed

    private void gameBoardButton84ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton84ActionPerformed
            // TODO add your handling code here:
        String result = game.updateMove(8, 4);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton84);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (8, 4)");
        }
    }//GEN-LAST:event_gameBoardButton84ActionPerformed

    private void gameBoardButton85ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton85ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(8, 5);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton85);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (8, 5)");
        }
    }//GEN-LAST:event_gameBoardButton85ActionPerformed

    private void gameBoardButton86ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton86ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(8, 6);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton86);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (8, 6)");
        }
    }//GEN-LAST:event_gameBoardButton86ActionPerformed

    private void gameBoardButton87ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton87ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(8, 7);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton87);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (8, 7)");
        }
    }//GEN-LAST:event_gameBoardButton87ActionPerformed

    private void gameBoardButton88ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton88ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(8, 8);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton88);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (8, 8)");
        }
    }//GEN-LAST:event_gameBoardButton88ActionPerformed

    private void gameBoardButton89ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton89ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(8, 9);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton89);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (8, 9)");
        }
    }//GEN-LAST:event_gameBoardButton89ActionPerformed

    private void gameBoardButton91ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton91ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(9, 1);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton91);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (9, 1)");
        }
    }//GEN-LAST:event_gameBoardButton91ActionPerformed

    private void gameBoardButton92ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton92ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(9, 2);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton92);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (9, 2)");
        }
    }//GEN-LAST:event_gameBoardButton92ActionPerformed

    private void gameBoardButton93ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton93ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(9, 3);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton93);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (9, 3)");
        }
    }//GEN-LAST:event_gameBoardButton93ActionPerformed

    private void gameBoardButton94ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton94ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(9, 4);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton94);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (9, 4)");
        }
    }//GEN-LAST:event_gameBoardButton94ActionPerformed

    private void gameBoardButton95ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton95ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(9, 5);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton95);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (9, 5)");
        }
    }//GEN-LAST:event_gameBoardButton95ActionPerformed

    private void gameBoardButton96ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton96ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(9, 6);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton96);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (9, 6)");
        }
    }//GEN-LAST:event_gameBoardButton96ActionPerformed

    private void gameBoardButton97ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton97ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(9, 7);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton97);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (9, 7)");
        }
    }//GEN-LAST:event_gameBoardButton97ActionPerformed

    private void gameBoardButton98ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton98ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(9, 8);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton98);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (9, 8)");
        }
    }//GEN-LAST:event_gameBoardButton98ActionPerformed

    private void gameBoardButton99ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gameBoardButton99ActionPerformed
        // TODO add your handling code here:
        String result = game.updateMove(9, 9);
        if(result.equals("??")){
            JOptionPane.showMessageDialog(rootPane, "Incorrect Move!!");
        }
        else
        {
            changeButtonColor(gameBoardButton99);
            updatePlayerStatus(result);
            pastMoves.setText(pastMoves.getText() + " : (9, 9)");
        }
    }//GEN-LAST:event_gameBoardButton99ActionPerformed

    private void helpButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_helpButtonActionPerformed
        // TODO add your handling code here:
        new Help().setVisible(true);
    }//GEN-LAST:event_helpButtonActionPerformed

    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton gameBoardButton11;
    private javax.swing.JButton gameBoardButton12;
    private javax.swing.JButton gameBoardButton13;
    private javax.swing.JButton gameBoardButton14;
    private javax.swing.JButton gameBoardButton15;
    private javax.swing.JButton gameBoardButton16;
    private javax.swing.JButton gameBoardButton17;
    private javax.swing.JButton gameBoardButton18;
    private javax.swing.JButton gameBoardButton19;
    private javax.swing.JButton gameBoardButton21;
    private javax.swing.JButton gameBoardButton22;
    private javax.swing.JButton gameBoardButton23;
    private javax.swing.JButton gameBoardButton24;
    private javax.swing.JButton gameBoardButton25;
    private javax.swing.JButton gameBoardButton26;
    private javax.swing.JButton gameBoardButton27;
    private javax.swing.JButton gameBoardButton28;
    private javax.swing.JButton gameBoardButton29;
    private javax.swing.JButton gameBoardButton31;
    private javax.swing.JButton gameBoardButton32;
    private javax.swing.JButton gameBoardButton33;
    private javax.swing.JButton gameBoardButton34;
    private javax.swing.JButton gameBoardButton35;
    private javax.swing.JButton gameBoardButton36;
    private javax.swing.JButton gameBoardButton37;
    private javax.swing.JButton gameBoardButton38;
    private javax.swing.JButton gameBoardButton39;
    private javax.swing.JButton gameBoardButton41;
    private javax.swing.JButton gameBoardButton42;
    private javax.swing.JButton gameBoardButton43;
    private javax.swing.JButton gameBoardButton44;
    private javax.swing.JButton gameBoardButton45;
    private javax.swing.JButton gameBoardButton46;
    private javax.swing.JButton gameBoardButton47;
    private javax.swing.JButton gameBoardButton48;
    private javax.swing.JButton gameBoardButton49;
    private javax.swing.JButton gameBoardButton51;
    private javax.swing.JButton gameBoardButton52;
    private javax.swing.JButton gameBoardButton53;
    private javax.swing.JButton gameBoardButton54;
    private javax.swing.JButton gameBoardButton55;
    private javax.swing.JButton gameBoardButton56;
    private javax.swing.JButton gameBoardButton57;
    private javax.swing.JButton gameBoardButton58;
    private javax.swing.JButton gameBoardButton59;
    private javax.swing.JButton gameBoardButton61;
    private javax.swing.JButton gameBoardButton62;
    private javax.swing.JButton gameBoardButton63;
    private javax.swing.JButton gameBoardButton64;
    private javax.swing.JButton gameBoardButton65;
    private javax.swing.JButton gameBoardButton66;
    private javax.swing.JButton gameBoardButton67;
    private javax.swing.JButton gameBoardButton68;
    private javax.swing.JButton gameBoardButton69;
    private javax.swing.JButton gameBoardButton71;
    private javax.swing.JButton gameBoardButton72;
    private javax.swing.JButton gameBoardButton73;
    private javax.swing.JButton gameBoardButton74;
    private javax.swing.JButton gameBoardButton75;
    private javax.swing.JButton gameBoardButton76;
    private javax.swing.JButton gameBoardButton77;
    private javax.swing.JButton gameBoardButton78;
    private javax.swing.JButton gameBoardButton79;
    private javax.swing.JButton gameBoardButton81;
    private javax.swing.JButton gameBoardButton82;
    private javax.swing.JButton gameBoardButton83;
    private javax.swing.JButton gameBoardButton84;
    private javax.swing.JButton gameBoardButton85;
    private javax.swing.JButton gameBoardButton86;
    private javax.swing.JButton gameBoardButton87;
    private javax.swing.JButton gameBoardButton88;
    private javax.swing.JButton gameBoardButton89;
    private javax.swing.JButton gameBoardButton91;
    private javax.swing.JButton gameBoardButton92;
    private javax.swing.JButton gameBoardButton93;
    private javax.swing.JButton gameBoardButton94;
    private javax.swing.JButton gameBoardButton95;
    private javax.swing.JButton gameBoardButton96;
    private javax.swing.JButton gameBoardButton97;
    private javax.swing.JButton gameBoardButton98;
    private javax.swing.JButton gameBoardButton99;
    private javax.swing.JButton gameTypeButton;
    private javax.swing.JButton helpButton;
    private javax.swing.JLabel hintText;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton21;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton31;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton41;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton51;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton61;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton71;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton81;
    private javax.swing.JButton jButton9;
    private javax.swing.JButton jButton91;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea pastMoves;
    private javax.swing.JLabel player1Name;
    private javax.swing.JLabel player1Status;
    private javax.swing.JLabel player2Name;
    private javax.swing.JLabel player2Status;
    // End of variables declaration//GEN-END:variables

}
